//
//  AgentReviewViewController.m
//  BaseProject
//
//  Created by 王洋 on 2021/3/2.
//  Copyright © 2021 王洋. All rights reserved.
//
#import "AgentApplyViewController.h"
#import "AgentReviewViewController.h"

@interface AgentReviewViewController ()


@property (weak, nonatomic) IBOutlet UIButton *handleBtn;

@end

@implementation AgentReviewViewController

- (void)viewDidLoad {
    [super viewDidLoad];

    self.title = @"推荐官申请";

    switch (self.model.examState) {
        case AgentReviewStatusType_review:{
            self.statusImage.hidden = YES;
            self.statusLab.text = @"正在审核中~";
            self.reasonLab.text = @"您提交的信息正在处理，请耐心等待";
            self.handleBtn.hidden = YES;

        } break;
        case AgentReviewStatusType_passed:{
            self.statusImage.hidden = YES;
            self.statusLab.text = @"恭喜！";
            self.reasonLab.text = @"审核已通过";
            self.handleBtn.hidden = YES;

        } break;
        case AgentReviewStatusType_refuse:{
            self.statusImage.hidden = NO;
            self.statusLab.text = @"审核未通过！";
            self.reasonLab.text = self.model.examReason;
            self.handleBtn.hidden = NO;

        } break;
        default:
            break;
    }
    
    self.userNameLab.text =[NSString stringWithFormat:@"真实姓名：%@",self.model.name];
    self.phoneLab.text =[NSString stringWithFormat:@"联系方式：%@",self.model.phone];
    self.cityLab.text = [NSString stringWithFormat:@"所在城市：%@",self.model.cityName];
    self.recGoldAgentLab.text = [NSString stringWithFormat:@"所属金牌推荐官：%@",self.model.recommendName];
}

- (void)viewWillLayoutSubviews {
    [super viewWillLayoutSubviews];
    
    dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.01 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
        [self.handleBtn pp_clipCorners:UIRectCornerAllCorners radius:self.handleBtn.frame.size.height/2];
    });
}

- (IBAction)reApplyAction:(id)sender {
    
    AgentApplyViewController *vc = [[AgentApplyViewController alloc] init];
    vc.model = self.model;
    [self.navigationController pushViewController:vc animated:YES];
}



@end
